/*
 多位数用逗号隔开，不处理小数部分
 */


function format(number) {
    let arr = number.split('.')
    let str = arr[0]
    let len = str.length
    let space = 3
    while(len>space){
        str = str.slice(0,len-space)+','+str.slice(len-space,str.length)
        len -=space
    }
    str +='.'+arr[1]
    return str
}

console.log(format('1200000000000.11000')); // 1,200,000,000,000.11000

